# Contributor: Sertonix <sertonix@posteo.net>
# Maintainer: Sertonix <sertonix@posteo.net>
pkgname=dinit
pkgver=0.17.1
pkgrel=0
pkgdesc="Service monitoring/init system"
url="https://github.com/davmac314/dinit"
arch="all"
license="Apache-2.0"
subpackages="$pkgname-doc $pkgname-shutdown:_shutdown"
makedepends="m4"
source="https://github.com/davmac314/dinit/releases/download/v$pkgver/dinit-$pkgver.tar.xz"

build() {
	make BUILD_SHUTDOWN=yes
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir"/ SHUTDOWN_PREFIX="dinit-" install
}

_shutdown() {
	pkgdesc="dinit shutdown utils"
	depends="$pkgname"

	amove sbin/dinit-shutdown
	amove sbin/dinit-halt
	amove sbin/dinit-reboot
	amove sbin/dinit-poweroff
}

sha512sums="
de78fc19b86b235266931079334f83bb92fd2a0dd801d8d83ad8df1294775192e2bf34a2aa47d3c8889bcd96884adfc3372a2a80c08ace457c6654cda1d07b6f  dinit-0.17.1.tar.xz
"
